<extend name="Public/base" />

<block name="style">


<link href="__STATIC__/iCheck/skins/flat/green.css" rel="stylesheet">
<link href="__STATIC__/select2/dist/css/select2.min.css" rel="stylesheet">
<!-- Switchery -->
<link href="__STATIC__/switchery/dist/switchery.min.css" rel="stylesheet">
<link href="__STATIC__/starrr/dist/starrr.css" rel="stylesheet">
<link href="__STATIC__/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
<script type="text/javascript" charset="utf-8" src="__STATIC__/umeditor/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/umeditor/umeditor.min.js"></script>

</block>
<block name="body">
<style>
      	.wrapper-border {
		vertical-align: top;
		letter-spacing: normal;
		word-spacing: normal;
		padding: 14px;
		position: relative;
		z-index: 1;
                list-style: none;
                float: left;
	}
    .text{
		background-color: #FFF;
		text-align: center;
		border: solid 1px #F5F5F5;
	}
	.text:hover{
		border-color: #27A9E3;
	}
	.text i{
		padding: 20px;
                line-height: 40px;
                font-size: 14px;
	}
	
	.text a.del {
		font-family: Tahoma;
		font-size: 10px;
		line-height: 14px;
		color: #CCC;
		background-color: #FFF;
		vertical-align: middle;
		text-align: center;
		display: none;
		width: 14px;
		height: 14px;
		border: solid 1px;
		border-radius: 8px;
		position: absolute;
		z-index: 2;
		top: 8px;
		right: 8px;
                text-decoration: none;
	}

	.text:hover a.del {
		color: #27A9E3;
		border-color: #27A9E3;
		display: block;
	}
	.text:hover a.del:hover {
		text-decoration: none;
	}
</style>
<!-- page content -->
<div class="right_col" role="main">
    <div class="">
        <div class="clearfix"></div>
        <div class="row">
            <ul class="tab-nav ">
                <li data-tab="tab1" class=""><a href="{:U('index')}">文章列表</a></li>

                <li data-tab="tab2" class="current"><a href="javascript:void(0);">{$meta_title}</a></li>

            </ul>

            <div class="col-md-12 col-xs-12">
                <div class="x_panel">

                    <div class="x_content">
                        <br />

                        <form action="{:U('')}" class="form1 form-horizontal row-border" >
                       
                            <div class="form-group">
                                <label class="col-md-2 control-label">标题*</label>
                                <div class="col-md-10">
                                    <input type="text" name="title" value="" placeholder="请输入文章标题" class="form-control">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label">关键词*</label>
                                <div class="col-md-10">
                                    <input type="text" name="keywords" value="" placeholder="请输入文章关键词" class="form-control">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label">文章来源</label>
                                <div class="col-md-10">
                                    <input type="text" name="source" value="" placeholder="请输文章来源" class="form-control">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-md-2 control-label">摘要</label>
                                <div class="col-md-10">
                                    <textarea name="excerpt"   class="form-control" rows="3" placeholder=''></textarea>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-md-2 control-label">内容</label>
                                <div class="col-md-10">
                                    {:hook('adminUMEditor', array('name'=>'content','value'=>""))}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label">缩略图片</label>
                                <div class="col-md-10">
                                    <div class="upload_file-button" onclick="$('.select_image_upload').click();
                                                          return false;"><!--点击上传图片-->
                                    </div>
                                    <div class="upload-img-box" onclick="$('.select_image_upload').click();
                                                        return false;"><!--存放图片-->    
                                                        <notempty name='info.icon'>
                                        <input type="hidden" name="thum" value="{$info.thum}">
                                        <img src="{$info.thum|get_file_url}" id="img_box" class="hei"> 
                                        <em class="edit_img_icon">&nbsp;</em>                              
                                                        </notempty>
                                    </div>
                                    <input type="file" name="image" class="input-file select_image_upload" style="display: none;">
                                </div>
                            </div>  







                            <div class="form-group">
                                <label class="col-md-2 control-label">状态</label>
                                <div class="col-md-10">

                                    <div class="radio">
                                        <label>
                                            <input type="radio" class="flat" checked name="status"> 审核通过
                                        </label>
                                    </div>
                                    <div class="radio">
                                        <label>
                                            <input type="radio" class="flat" name="status"> 待审核
                                        </label>
                                    </div>


                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label"></label>
                                <div class="col-md-10">

                                    <div class="radio">
                                        <label>
                                            <input type="radio" class="flat" checked name="istop"> 置顶
                                        </label>
                                    </div>
                                    <div class="radio">
                                        <label>
                                            <input type="radio" class="flat" name="istop"> 未置顶
                                        </label>
                                    </div>


                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label"></label>
                                <div class="col-md-10">

                                    <div class="radio">
                                        <label>
                                            <input type="radio" class="flat" checked name="recommended"> 推荐
                                        </label>
                                    </div>
                                    <div class="radio">
                                        <label>
                                            <input type="radio" class="flat" name="recommended"> 未推荐
                                        </label>
                                    </div>


                                </div>
                            </div>



                            <div class="x_title">
                                <h2><i class="fa fa-align-left"></i> 高级 </h2>
                                <ul class="nav navbar-right panel_toolbox">
                                    <li><a class="collapse-link1"><i class="fa fa-chevron-up"></i></a>
                                    </li>


                                </ul>
                                <div class="clearfix"></div>
                            </div>

                            <div class="x_content1" style="display: block;">
                                <br>


                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">图片集</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">


                                        <input type="hidden" name="smeta" id="smeta" value=""/>
                                        <div class="upload_file-button" onclick="$('.select_image_upload_multiple').click();
                                                      return false;"><!--点击上传图片-->
                                        </div>

                                        <input type="file" name="image" multiple class="input-file select_image_upload_multiple" style="display: none;">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">发布时间</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <input type="text" name="modified_time" id="single_cal4" value="<?php echo date('Y-m-d H:i:s');?>" class="form-control "   placeholder="根据网页标题">
                                    </div>
                                </div>  
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">浏览量</label>
                                    <div class="col-md-2 col-sm-2 col-xs-12">
                                        <input type="text" name="post_hits" value="10" class="form-control "   placeholder="10">


                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">评论数</label>
                                    <div class="col-md-2 col-sm-2 col-xs-12">
                                        <input type="text" name="comment_count" value="10" class="form-control "   placeholder="10">


                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">收藏数</label>
                                    <div class="col-md-2 col-sm-2 col-xs-12">
                                        <input type="text" name="praise_count" value="10" class="form-control "   placeholder="10">
                                    </div>
                                </div>    


                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">外链</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <input type="text" name="outside_url" value="" class="form-control "   placeholder="0-非外链，大于0-外链ID,需要函数进行链接与编号的转换">
                                    </div>
                                </div>



                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">详情页显示模板</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <input type="text" name="template_detail" value="" class="form-control "   placeholder="请输入频道模板">


                                    </div>
                                </div>
              
                                
                   


                            </div>


                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <button type="submit" class="btn btn-info">新增文章</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>






        </div>
    </div>
</div>
</block>
<block name="script">





<!-- iCheck -->
<script src="__STATIC__/iCheck/icheck.min.js"></script>
<!-- Select2 -->
<script src="__STATIC__/select2/dist/js/select2.full.min.js"></script>
<!-- jQuery Tags Input -->
<script src="__STATIC__/jquery.tagsinput/src/jquery.tagsinput.js"></script>
<!-- Switchery -->
<script src="__STATIC__/switchery/dist/switchery.min.js"></script>
<!-- jQuery autocomplete -->
<script src="__STATIC__/devbridge-autocomplete/dist/jquery.autocomplete.min.js"></script>
<!-- Autosize -->     
<script src="__STATIC__/autosize/dist/autosize.min.js"></script>
<!-- starrr -->
<script src="__STATIC__/starrr/dist/starrr.js"></script>


<script src="__STATIC__/moment/moment.min.js"></script>
<script src="__STATIC__/datepicker/daterangepicker.js"></script>


<script type="text/javascript" src="__STATIC__/jquery-upload/js/jquery.iframe-transport.js" charset="utf-8"></script> 
<script type="text/javascript" src="__STATIC__/jquery-upload/js/vendor/jquery.ui.widget.js" charset="utf-8"></script> 
<script type="text/javascript" src="__STATIC__/jquery-upload/js/jquery.fileupload.min.js" charset="utf-8"></script>

<!-- Select2 -->
<script>
     function log( message ) {
      $( "<li class='wrapper-border'>" ).html( message ).prependTo( "#tag_list" );
 
      $( "#log" ).scrollTop( 0 );
    }

          $(".tag_submit_btn").click(function(){
              var tag=$("#new_tags").val();
              if(tag==''){
                  ui.error("标签不能为空");
              }
              log('<div class="text"><input type="hidden" name="h_name[]" value="'+tag+'"><i>'+tag+'</i><a href="javascript:void(0)" nctype="del" class="del" title="移除">X</a></div>')
               $('.del').bind("click",function(){
                    $(this).closest("li").remove();
                    });
                    $("#new_tags").val("");
          });


                                              $(".select_image_upload_multiple").fileupload({
                                      dataType: 'json',
                                              url: '{:U('File/uploadPicture')}',
                                              formData: {},
                                              add: function (e, data) {
                                              data.submit();
                                              },
                                              done: function (e, data) {
                                              var param = data.result;
                                                      if (param.code == 1) {
                                              var str = $("#smeta").val();
                                                      var sb = StringOperate.add(str, param.data.id);
                                                      $("#smeta").val(sb);
                                                      var html = '<div class="col-md-55"><div class="thumbnail"  style="height: auto"><img style="width: 100%; display: block; height:100px;" src="' + param.data.path + '" alt="image"></div><a href="javascript:void(0)" class="del"   title="移除" delid="' + param.data.id + '">X</a></div>';
                                                      $(this).parent().prepend(html);
                                                      $(".del").click(function(){
                                              var str = $("#smeta").val();
                                                      var delid = $(this).attr("delid");
                                                      var sb = StringOperate.remove(str, delid);
                                                      $("#smeta").val(sb);
                                                      $(this).closest(".col-md-55").fadeOut("fast", function (){
                                              $(this).remove();
                                                      });
                                              });
                                              } else {
                                              ui.error(param.msg);
                                              }

                                              }
                                      });
                                              $(".select_image_upload").fileupload({
                                      dataType: 'json',
                                              url: '{:U('File/uploadPicture')}',
                                              formData: {},
                                              add: function (e, data) {
                                              data.submit();
                                              },
                                              done: function (e, data) {
                                              var param = data.result;
                                                      if (param.code == 1) {


                                              $(this).parent().find(".upload-img-box").html('<input type="hidden" name="thum" value="' + param.data.id + '"  /><img src="' + param.data.path + '"  id="img_box1" class="hei"> <em class="edit_img_icon">&nbsp;</em>');
                                              } else {
                                              ui.error(param.msg);
                                              }

                                              }
                                      });
                                              var validator = {
                                              message: 'This value is not valid',
                                                      feedbackIcons: {
                                                      valid: 'glyphicon glyphicon-ok',
                                                              invalid: 'glyphicon glyphicon-remove',
                                                              validating: 'glyphicon glyphicon-refresh'
                                                      },
                                                      fields: {
                                                      'term[]': {
                                                      validators: {
                                                      notEmpty: {
                                                      message: '选择分类'
                                                      }

                                                      }
                                                      },
                                                             title: {
                                                              validators: {
                                                              notEmpty: {
                                                              message: '模型名称不能为空'
                                                              }
                                                              }
                                                              }


                                                      }
                                              };
                                              $(document).ready(function () {

                                      $('.collapse-link1').on('click', function() {
                                      var $BOX_PANEL = $(this).closest('.x_panel'),
                                              $ICON = $(this).find('i'),
                                              $BOX_CONTENT = $BOX_PANEL.find('.x_content1');
                                              // fix for some div with hardcoded fix class
                                              if ($BOX_PANEL.attr('style')) {
                                      $BOX_CONTENT.slideToggle(200, function(){
                                      $BOX_PANEL.removeAttr('style');
                                      });
                                      } else {
                                      $BOX_CONTENT.slideToggle(200);
                                              $BOX_PANEL.css('height', 'auto');
                                      }

                                      $ICON.toggleClass('fa-chevron-up fa-chevron-down');
                                      });
                                              $(".select2_single").select2({
                                      placeholder: "Select a state",
                                              allowClear: true
                                      });
                                              $(".select2_group").select2({});
                                              $(".select2_multiple").select2({
                                      maximumSelectionLength: 4,
                                              placeholder: "With Max Selection limit 4",
                                              allowClear: true
                                      });
                                      });</script>
<!-- /Select2 -->

<!-- jQuery Tags Input -->
<script>
            function onAddTag(tag) {
            alert("Added a tag: " + tag);
            }

    function onRemoveTag(tag) {
    alert("Removed a tag: " + tag);
    }

    function onChangeTag(input, tag) {
    alert("Changed a tag: " + tag);
    }

    $(document).ready(function () {
    $('#tags_1').tagsInput({
    width: 'auto'
    });
    });</script>
<!-- /jQuery Tags Input -->


<!-- Autosize -->
<script>
            $(document).ready(function () {
    autosize($('.resizable_textarea'));
    });</script>
<!-- /Autosize -->

<!-- jQuery autocomplete -->
<script>
            $(document).ready(function () {
    var countries = {AD: "Andorra", A2: "Andorra Test", AE: "United Arab Emirates", AF: "Afghanistan", AG: "Antigua and Barbuda", AI: "Anguilla", AL: "Albania", AM: "Armenia", AN: "Netherlands Antilles", AO: "Angola", AQ: "Antarctica", AR: "Argentina", AS: "American Samoa", AT: "Austria", AU: "Australia", AW: "Aruba", AX: "Åland Islands", AZ: "Azerbaijan", BA: "Bosnia and Herzegovina", BB: "Barbados", BD: "Bangladesh", BE: "Belgium", BF: "Burkina Faso", BG: "Bulgaria", BH: "Bahrain", BI: "Burundi", BJ: "Benin", BL: "Saint Barthélemy", BM: "Bermuda", BN: "Brunei", BO: "Bolivia", BQ: "British Antarctic Territory", BR: "Brazil", BS: "Bahamas", BT: "Bhutan", BV: "Bouvet Island", BW: "Botswana", BY: "Belarus", BZ: "Belize", CA: "Canada", CC: "Cocos [Keeling] Islands", CD: "Congo - Kinshasa", CF: "Central African Republic", CG: "Congo - Brazzaville", CH: "Switzerland", CI: "Côte d’Ivoire", CK: "Cook Islands", CL: "Chile", CM: "Cameroon", CN: "China", CO: "Colombia", CR: "Costa Rica", CS: "Serbia and Montenegro", CT: "Canton and Enderbury Islands", CU: "Cuba", CV: "Cape Verde", CX: "Christmas Island", CY: "Cyprus", CZ: "Czech Republic", DD: "East Germany", DE: "Germany", DJ: "Djibouti", DK: "Denmark", DM: "Dominica", DO: "Dominican Republic", DZ: "Algeria", EC: "Ecuador", EE: "Estonia", EG: "Egypt", EH: "Western Sahara", ER: "Eritrea", ES: "Spain", ET: "Ethiopia", FI: "Finland", FJ: "Fiji", FK: "Falkland Islands", FM: "Micronesia", FO: "Faroe Islands", FQ: "French Southern and Antarctic Territories", FR: "France", FX: "Metropolitan France", GA: "Gabon", GB: "United Kingdom", GD: "Grenada", GE: "Georgia", GF: "French Guiana", GG: "Guernsey", GH: "Ghana", GI: "Gibraltar", GL: "Greenland", GM: "Gambia", GN: "Guinea", GP: "Guadeloupe", GQ: "Equatorial Guinea", GR: "Greece", GS: "South Georgia and the South Sandwich Islands", GT: "Guatemala", GU: "Guam", GW: "Guinea-Bissau", GY: "Guyana", HK: "Hong Kong SAR China", HM: "Heard Island and McDonald Islands", HN: "Honduras", HR: "Croatia", HT: "Haiti", HU: "Hungary", ID: "Indonesia", IE: "Ireland", IL: "Israel", IM: "Isle of Man", IN: "India", IO: "British Indian Ocean Territory", IQ: "Iraq", IR: "Iran", IS: "Iceland", IT: "Italy", JE: "Jersey", JM: "Jamaica", JO: "Jordan", JP: "Japan", JT: "Johnston Island", KE: "Kenya", KG: "Kyrgyzstan", KH: "Cambodia", KI: "Kiribati", KM: "Comoros", KN: "Saint Kitts and Nevis", KP: "North Korea", KR: "South Korea", KW: "Kuwait", KY: "Cayman Islands", KZ: "Kazakhstan", LA: "Laos", LB: "Lebanon", LC: "Saint Lucia", LI: "Liechtenstein", LK: "Sri Lanka", LR: "Liberia", LS: "Lesotho", LT: "Lithuania", LU: "Luxembourg", LV: "Latvia", LY: "Libya", MA: "Morocco", MC: "Monaco", MD: "Moldova", ME: "Montenegro", MF: "Saint Martin", MG: "Madagascar", MH: "Marshall Islands", MI: "Midway Islands", MK: "Macedonia", ML: "Mali", MM: "Myanmar [Burma]", MN: "Mongolia", MO: "Macau SAR China", MP: "Northern Mariana Islands", MQ: "Martinique", MR: "Mauritania", MS: "Montserrat", MT: "Malta", MU: "Mauritius", MV: "Maldives", MW: "Malawi", MX: "Mexico", MY: "Malaysia", MZ: "Mozambique", NA: "Namibia", NC: "New Caledonia", NE: "Niger", NF: "Norfolk Island", NG: "Nigeria", NI: "Nicaragua", NL: "Netherlands", NO: "Norway", NP: "Nepal", NQ: "Dronning Maud Land", NR: "Nauru", NT: "Neutral Zone", NU: "Niue", NZ: "New Zealand", OM: "Oman", PA: "Panama", PC: "Pacific Islands Trust Territory", PE: "Peru", PF: "French Polynesia", PG: "Papua New Guinea", PH: "Philippines", PK: "Pakistan", PL: "Poland", PM: "Saint Pierre and Miquelon", PN: "Pitcairn Islands", PR: "Puerto Rico", PS: "Palestinian Territories", PT: "Portugal", PU: "U.S. Miscellaneous Pacific Islands", PW: "Palau", PY: "Paraguay", PZ: "Panama Canal Zone", QA: "Qatar", RE: "Réunion", RO: "Romania", RS: "Serbia", RU: "Russia", RW: "Rwanda", SA: "Saudi Arabia", SB: "Solomon Islands", SC: "Seychelles", SD: "Sudan", SE: "Sweden", SG: "Singapore", SH: "Saint Helena", SI: "Slovenia", SJ: "Svalbard and Jan Mayen", SK: "Slovakia", SL: "Sierra Leone", SM: "San Marino", SN: "Senegal", SO: "Somalia", SR: "Suriname", ST: "São Tomé and Príncipe", SU: "Union of Soviet Socialist Republics", SV: "El Salvador", SY: "Syria", SZ: "Swaziland", TC: "Turks and Caicos Islands", TD: "Chad", TF: "French Southern Territories", TG: "Togo", TH: "Thailand", TJ: "Tajikistan", TK: "Tokelau", TL: "Timor-Leste", TM: "Turkmenistan", TN: "Tunisia", TO: "Tonga", TR: "Turkey", TT: "Trinidad and Tobago", TV: "Tuvalu", TW: "Taiwan", TZ: "Tanzania", UA: "Ukraine", UG: "Uganda", UM: "U.S. Minor Outlying Islands", US: "United States", UY: "Uruguay", UZ: "Uzbekistan", VA: "Vatican City", VC: "Saint Vincent and the Grenadines", VD: "North Vietnam", VE: "Venezuela", VG: "British Virgin Islands", VI: "U.S. Virgin Islands", VN: "Vietnam", VU: "Vanuatu", WF: "Wallis and Futuna", WK: "Wake Island", WS: "Samoa", YD: "People's Democratic Republic of Yemen", YE: "Yemen", YT: "Mayotte", ZA: "South Africa", ZM: "Zambia", ZW: "Zimbabwe", ZZ: "Unknown or Invalid Region"};
            var countriesArray = $.map(countries, function (value, key) {
            return {
            value: value,
                    data: key
            };
            });
            // initialize autocomplete with custom appendTo
            $('#autocomplete-custom-append').autocomplete({
    lookup: countriesArray
    });
    });</script>
<!-- /jQuery autocomplete -->

<!-- Starrr -->
<script>
            $(document).ready(function () {

    $('#single_cal4').daterangepicker({
    format: 'YYYY-MM-DD h:mm A',
            "autoApply": true,
            "singleDatePicker": true,
            "showDropdowns": true,
            "showWeekNumbers": true,
            "showISOWeekNumbers": true,
            "timePicker": true,
            "timePicker24Hour": true,
            calender_style: "picker_2"
    }, function (start, end, label) {
    console.log(start.toISOString(), end.toISOString(), label);
    });
            $(".stars").starrr();
            $('.stars-existing').starrr({
    rating: 4
    });
            $('.stars').on('starrr:change', function (e, value) {
    $('.stars-count').html(value);
    });
            $('.stars-existing').on('starrr:change', function (e, value) {
    $('.stars-count-existing').html(value);
    });
    });
            Lzy.highlight_subnav('{:U('Article/index')}');
</script>
</block>